home *** CD-ROM | disk | FTP | other *** search
/ Webster's Millennium Amer…Sign Language Dictionary / ASL.ISO / mac / SKILLS.dir / 00071_Script_test Questions < prev    next >
Text File  |  2001-09-05  |  22KB  |  637 lines

  1. on getQuestions
  2.   global gDataType,gTestType,gNumQs,gDataSource,gHistoryData,gDownLoads
  3.   global gWordList,gAlphabet,gTestList,gTestResults,gTestScore
  4.   global scrollList,gGameCat,bad,myAlertWindow,gBackToSetUp, gTestEnd
  5.   global gCurrentUser
  6.   if gTestType = "multiple choice" then setUpTest
  7.   set gTestList = []
  8.   set gTestResults = []
  9.   set bad = []
  10.   set gtestListing = ""
  11.   set gBackToSetUp = 0
  12.   set gTestEnd = 0
  13.   cursor 4
  14.   
  15.   if gDataType = "fs" then
  16.     repeat while (count(gTestList) < gNumQs)
  17.       put getAt(gAlphabet,random(26)) into aLetter
  18.       if getPos(gTestList,aLetter)=0 then 
  19.         add gTestList,aLetter
  20.         set gtestListing = gtestListing&aLetter&return
  21.         add gTestResults,"not tested"
  22.       end if
  23.     end repeat
  24.   else
  25.     --alertBox "Preparing Questions..."
  26.     if gDataSource = "entire dictionary" then
  27.       --
  28.       repeat while (count(gtestList) < gNumQs)
  29.         put getAt(gWordList,random(count(gWordList))) into aWord
  30.         if not goodMedia(getPos(gWordList,aWord)) then next repeat
  31.         if getPos(gtestList,aWord)=0 then 
  32.           add gtestList,aWord
  33.           set gtestListing = gtestListing&aWord&return
  34.           add gTestResults,"not tested"
  35.         end if
  36.       end repeat
  37.       --
  38.     else if gDataSource = "category" and not (gGameCat = "") then
  39.       ----
  40.       -- use category words 
  41.       if gGameCat = "DownLoaded Signs" then 
  42.         put gDownLoads into catWords  
  43.       else
  44.         
  45.         
  46.         --PETEMACK 09.05.01
  47.         --        tell window "dData" to put the number of cast (gGameCat&"."&gCurrentUser) into userCat
  48.         --        if userCat > 0 then 
  49.         --          tell window "dData" to put field (gGameCat&"."&gCurrentUser) into catWords
  50.         --        else tell window "dData" to put field gGameCat into catWords
  51.         
  52.         
  53.         set vRandomPick = random(29) --PETEMACK 09.05.01
  54.         set vRandomPick = vRandomPick + 30 --PETEMACK 09.05.01
  55.         tell window "dData" to set vCatName = the name of member vRandomPick --PETEMACK 09.05.01
  56.         alert string(vCatName && "Category Randomly Selected") --PETEMACK 09.05.01
  57.         tell window "dData" to put field vRandomPick into catWords --PETEMACK 09.05.01
  58.         
  59.         
  60.       end if
  61.       
  62.       set catList = getStringToList(catWords)
  63.       repeat while (count(gtestList) < gNumQs) and (count(gtestList) < count(catList)-count(bad))
  64.         set aWord = getAt(catList,random(count(catList)))
  65.         if not goodMedia(getPos(gWordList,aWord)) then
  66.           if getPos(bad,aWord) = 0 then add bad, aWord
  67.           next repeat
  68.         end if
  69.         if getPos(gtestList,aWord)=0 then 
  70.           add gtestList,aWord
  71.           set gtestListing = gtestListing&aWord&return
  72.           add gTestResults,"not tested"
  73.         end if
  74.       end repeat
  75.       ----
  76.     else
  77.       ----
  78.       -- use history data = previous sessions, current session or previous test
  79.       repeat while (count(gtestList) < gNumQs) and (count(gtestList) < count(gHistoryData)-count(bad))
  80.         put getAt(gHistoryData,random(count(gHistoryData))) into aWord
  81.         if not goodMedia(getPos(gWordList,aWord)) then 
  82.           if getPos(bad,aWord) = 0 then add bad, aWord
  83.           next repeat
  84.         end if
  85.         if getPos(gtestList,aWord)=0 then 
  86.           add gtestList,aWord
  87.           set gtestListing = gtestListing&aWord&return
  88.           add gTestResults,"not tested"
  89.         end if
  90.       end repeat
  91.       ----
  92.     end if
  93.     ---- if history data or category contains less than requested # of questions
  94.     ---- then fill in with gWordList i.e. entire dictionary
  95.     if (count(gtestList) < gNumQs) then
  96.       repeat while (count(gtestList) < gNumQs)
  97.         put getAt(gWordList,random(count(gWordList))) into aWord
  98.         if not goodMedia(getPos(gWordList,aWord)) then next repeat
  99.         if getPos(gtestList,aWord)=0 then 
  100.           add gtestList,aWord
  101.           set gtestListing = gtestListing&aWord&return
  102.           add gTestResults,"not tested"
  103.         end if
  104.       end repeat
  105.     end if
  106.     ----
  107.   end if
  108.   set gTestScore = 0
  109.   set the text of cast "testScore" = "Points Scored: "&gTestScore
  110.   
  111.   --  if objectp(myAlertWindow) then 
  112.   --    close myAlertWindow
  113.   --    forget myAlertWindow
  114.   --  end if
  115.   
  116.   cursor 0
  117. end getQuestions
  118.  
  119. on setUpTest
  120.   global gNumQs,gGameCat
  121.   global maxScroll,minScroll
  122.   set minScroll = 1
  123.   set maxScroll = gNumQs
  124.   
  125.   set the visible of sprite 25 = false
  126.   set the visible of sprite 26 = false
  127.   set the visible of sprite 27 = false
  128.   set the visible of sprite 28 = false
  129.   set the visible of sprite 39 = false
  130. end setUpTest
  131.  
  132. on aQuestion WhichQuestion
  133.   global gTest,gTestType,gGameCat,gDownLoads
  134.   global gDataType,gDataSource,bad
  135.   global gWordList,gAlphabet,gTestList
  136.   global gCurrentQuestion,gNumQs,gHistoryData,gWordList
  137.   global gCurrentUser
  138.   cursor 4
  139.   if WhichQuestion = "" or voidp(WhichQuestion) then exit
  140.   --if gTest then 
  141.   set the text of cast "whichq" = string(integer(whichQuestion))&&"of"&&gNumQs
  142.   
  143.   resetQCasts
  144.   
  145.   set gCurrentQuestion = whichQuestion
  146.   if whichQuestion < 1 or whichQuestion > count(gTestList) then exit
  147.   set gQuestionList = []
  148.   add gQuestionList, getAt(gTestList,whichQuestion)
  149.   if gDataType = "fs" then
  150.     repeat while (count(gQuestionList) < 4)
  151.       put getAt(gAlphabet,random(26)) into aLetter
  152.       if getPos(gQuestionList,aLetter)=0 then 
  153.         add gQuestionList,aLetter
  154.       end if
  155.     end repeat
  156.   else
  157.     --••••••••••
  158.     -- If a category was chosen then,
  159.     -- use category words to fill in the 
  160.     -- multiple choice sets.
  161.     
  162.     set catList = []
  163.     
  164.     if not (gGameCat = "") and not voidp(gGameCat) then 
  165.       if gGameCat = "DownLoaded Signs" then 
  166.         put gDownLoads into catWords  
  167.       else
  168.         
  169.         tell window "dData" to put the number of cast (gGameCat&"."&gCurrentUser) into userCat
  170.         if userCat > 0 then 
  171.           tell window "dData" to put field (gGameCat&"."&gCurrentUser) into catWords
  172.         else tell window "dData" to put field gGameCat into catWords
  173.         
  174.       end if
  175.       
  176.       set catList = getStringToList(catWords)
  177.     end if
  178.     
  179.     repeat while (count(gQuestionList) < 4)
  180.       
  181.       -- If a category or history data is used and has less than  
  182.       -- 10 words, it could be difficult
  183.       -- to quickly form unique multiple choice sets.  
  184.       -- In this case, use the entire dictionary.
  185.       -- This problem will only occur where users choose
  186.       -- one of their own categories with very few words.
  187.       
  188.       if gDataSource = "entire dictionary" then
  189.         put getAt(gWordList,random(count(gWordList))) into aWord
  190.       else if gDataSource = "category" and not (gGameCat = "") then
  191.         ----
  192.         -- use category words 
  193.         if count(catList)-count(bad) < 10 then
  194.           put getAt(gWordList,random(count(gWordList))) into aWord
  195.         else put getAt(catList,random(count(catList))) into aWord
  196.         ----
  197.       else
  198.         ----
  199.         -- use history data = previous sessions, current session or previous test
  200.         if count(gHistoryData)-count(bad) < 10 then
  201.           put getAt(gWordList,random(count(gWordList))) into aWord
  202.         else put getAt(gHistoryData,random(count(gHistoryData))) into aWord
  203.         ----
  204.       end if
  205.       
  206.       if not goodMedia(getPos(gWordList,aWord)) then next repeat
  207.       if getPos(gQuestionList,aWord)=0 then 
  208.         add gQuestionList,aWord
  209.       end if
  210.     end repeat
  211.     
  212.   end if
  213.   cursor 0
  214.   displayQuestion scrambleQ(gQuestionList)
  215. end aQuestion
  216.  
  217. on aFillInQuestion whichQuestion
  218.   global gCurrentQuestion,gNumQs
  219.   global TEMPLATE1, KNOB1, minPos1, maxPos1
  220.   global maxscroll,minScroll,gCat,ScrollList
  221.   
  222.   set the visible of sprite 39 = false
  223.   
  224.   if whichQuestion > 1 then
  225.     put maxscroll*1.0-minScroll*1.0 into scrollRange
  226.     put scrollRange/(maxPos1-minPos1) into scrollRatio
  227.     put max(integer((maxPos1-minPos1)/scrollRange),1) into sliderRatio
  228.     
  229.     set the locH of sprite KNOB1 = max( minPos1, min( (the locH of sprite KNOB1 + sliderRatio) , maxPos1 ) )
  230.   end if
  231.   set gCurrentQuestion = whichQuestion
  232.   VideoDisplay
  233.   set the visible of sprite 39 = true
  234.   set the text of cast "whichq" = string(integer(whichQuestion))&&"of"&&gNumQs
  235. end aFillInQuestion
  236.  
  237. --on checkFillAnswer
  238. --  global gNumQs,gTest,gCLockon,gBackToSetUp
  239. --  global gTestList,gCurrentQuestion,gTestScore
  240. --  put 10 into spriteClicked
  241. --  --put the clickOn into spriteClicked
  242. --  set checkThis = the text of cast "fill-in word"
  243. --  set answerCorrect = EvalFillInAnswer(checkThis,getAt(gTestList,gCurrentQuestion))
  244. --  
  245. --  set qStatus = getAt(gTestResults,gCurrentQuestion)
  246. --  if qStatus = "not tested" then set qStatus = "1"
  247. --  else set qStatus = string(integer(qStatus)+1)
  248. --  
  249. --  if answerCorrect then
  250. --    if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
  251. --    else setAt(gTestResults,gCurrentQuestion,qStatus&" Ø")
  252. --    rightAnswer spriteClicked
  253. --    put "" into field "fill-in word"
  254. --    set gTestScore = gTestScore+1
  255. --    set the text of cast "testScore" = "Points Scored: "&gTestScore
  256. --    startTimer
  257. --    repeat while the timer < 180 --aTimer = 1 to 3000
  258. --      nothing
  259. --    end repeat
  260. --  else
  261. --    if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
  262. --    else setAt(gTestResults,gCurrentQuestion,qStatus)
  263. --    wrongAnswer spriteClicked 
  264. --    put "" into field "fill-in word"
  265. --    startTimer
  266. --    repeat while the timer < 180 --aTimer = 1 to 3000
  267. --      nothing
  268. --    end repeat
  269. --  end if
  270. --  set cstNum = the number of cast "test blank" 
  271. --  set the castNum of sprite spriteClicked =cstNum
  272. --  if gCurrentQuestion < gNumQs then 
  273. --    put "" into field "fill-in word"
  274. --    aFillInQuestion gCurrentQuestion+1
  275. --  else 
  276. --    set gClockon = false
  277. --    if gTest then mouseUp (script "summary script")
  278. --    set gBackToSetUp = 1
  279. --    --
  280. --  end if
  281. --end checkFillAnswer
  282.  
  283. on checkFillAnswer
  284.   global sync
  285.   
  286.   set sync = 1
  287.   global gTimeTime, gSeconds
  288.   put gSeconds into gTimetime
  289.   
  290.   
  291.   global gNumQs,gTest,gCLockon,gBackToSetUp,gTestResults,gCurrentQuestion
  292.   global gTestList,gCurrentQuestion,gTestScore
  293.   
  294.   put 10 into spriteClicked
  295.   --put the clickOn into spriteClicked
  296.   set checkThis = the text of cast "fill-in word"
  297.   set answerCorrect = EvalFillInAnswer(checkThis,getAt(gTestList,gCurrentQuestion))
  298.   
  299.   set qStatus = getAt(gTestResults,gCurrentQuestion)
  300.   if qStatus = "not tested" then set qStatus = "1"
  301.   else set qStatus = string(integer(qStatus)+1)
  302.   
  303.   if answerCorrect then
  304.     if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
  305.     else setAt(gTestResults,gCurrentQuestion,qStatus&" Ø")
  306.     rightAnswer spriteClicked
  307.     put "" into field "fill-in word"
  308.     set gTestScore = gTestScore+1
  309.     set the text of cast "testScore" = "Points Scored: "&gTestScore
  310.     startTimer
  311.     repeat while the timer < 180 --aTimer = 1 to 3000
  312.       nothing
  313.     end repeat
  314.   else
  315.     if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
  316.     else setAt(gTestResults,gCurrentQuestion,qStatus)
  317.     wrongAnswer spriteClicked 
  318.     put "" into field "fill-in word"
  319.     startTimer
  320.     repeat while the timer < 180 --aTimer = 1 to 3000
  321.       nothing
  322.     end repeat
  323.   end if
  324.   set cstNum = the number of cast "test blank" 
  325.   set the castNum of sprite spriteClicked =cstNum
  326.   if gCurrentQuestion < gNumQs then 
  327.     put "" into field "fill-in word"
  328.     aFillInQuestion gCurrentQuestion+1
  329.   else 
  330.     set gClockon = false
  331.     if gTest then mouseUp (script "summary script")
  332.     set gBackToSetUp = 1
  333.     --
  334.   end if
  335. end checkFillAnswer
  336.  
  337.  
  338. on EvalFillInAnswer userAnswer,systemAnswer
  339.   global gDataType
  340.   if gDataType = "fs" then
  341.     return (userAnswer=systemAnswer)
  342.   else  --return (userAnswer=systemAnswer)
  343.     
  344.     tell window "dData" to put the number of cast systemAnswer into RefNum
  345.     tell window "dData" to put the text of cast RefNum into dataVar
  346.     set the itemdelimiter to "*"
  347.     put getXRefs(dataVar) into sharedSigns
  348.     set the itemdelimiter to ","
  349.     
  350.     if systemAnswer contains "/" then
  351.       set the itemdelimiter to "/"
  352.       repeat with i = 1 to the number of items of systemAnswer
  353.         put return&item i of systemAnswer after sharedSigns
  354.       end repeat
  355.       set the itemdelimiter to ","
  356.     else put return&systemAnswer after sharedSigns
  357.     
  358.     repeat with i = 1 to the number of lines of sharedSigns
  359.       if line i of sharedSigns = "" then next repeat
  360.       if stripChars(line i of sharedSigns,userAnswer) = true then return true
  361.     end repeat
  362.     
  363.     return (userAnswer=systemAnswer)
  364.   end if
  365. end 
  366.  
  367. on stripChars systemData,userAnswer
  368.   set strippedSystemData = ""
  369.   repeat with i = 1 to the number of chars of systemData
  370.     if ("1234567890!@#$%^&*()_+-=[]\{}|;':./<>?~`/""E&TAB) contains char i of systemData then
  371.       next repeat
  372.     else if not (char i of systemData = " ") then put char i of systemData after strippedSystemData
  373.   end repeat
  374.   
  375.   set strippedUserAnswer = ""
  376.   repeat with i = 1 to the number of chars of userAnswer
  377.     if ("1234567890!@#$%^&*()_+-=[]\{}|;':./<>?~`/""E&TAB) contains char i of userAnswer then
  378.       next repeat
  379.     else if not (char i of userAnswer = " ") then put char i of userAnswer after strippedUserAnswer
  380.   end repeat
  381.   return (strippedSystemData=strippedUserAnswer)
  382. end 
  383.  
  384. on displayQuestion qList
  385.   setUpTest
  386.   repeat with i = 1 to count(qList)
  387.     set the text of cast ("word"&&string(i)) = getAt(qList,i)
  388.     set vSprite = value(i+24) --PETEMACK 07.05.01
  389.     set the visible of sprite vSprite = true --PETEMACK 07.05.01
  390.     updatestage
  391.   end repeat
  392.   videoDisplay
  393.   set the visible of sprite 39 = true
  394. end displayQuestion
  395.  
  396. on scrambleQ TheList
  397.   global gCurrentQList
  398.   put false into finished
  399.   set testList = []
  400.   set returnList = []
  401.   set returnvals = ""
  402.   repeat while not finished
  403.     set nextVal = random(count(theList))
  404.     if getPos(testList,nextVal) = 0 then
  405.       append returnList, getAt(TheList,nextVal)
  406.       append testList,nextVal
  407.     end if
  408.     if count(returnList) = 4 then set finished = true
  409.   end repeat
  410.   set gCurrentQList = returnList
  411.   return returnList
  412. end scrambleQ
  413.  
  414. --on checkAnswer
  415. --  global gTest,gNumQs,gClockon
  416. --  global gTestList,gTestResults
  417. --  global gCurrentQuestion,gCurrentQList,gTestScore,gBackToSetUp
  418. --  
  419. --  sound stop 3
  420. --  resetQCasts
  421. --  put the clickOn into spriteClicked
  422. --  put spriteClicked+14 into textBox
  423. --  if spriteClicked < 29 then 
  424. --    put spriteClicked+34 into textBox
  425. --    set spriteClicked=spriteClicked+20
  426. --  end if
  427. --  --put textBox
  428. --  set checkLoc = spriteClicked-28
  429. --  set qStatus = getAt(gTestResults,gCurrentQuestion)
  430. --  
  431. --  if qStatus = "not tested" then set qStatus = "1"
  432. --  else set qStatus = string(integer(qStatus)+1)
  433. --  
  434. --  if getAt(gCurrentQList,checkLoc) = getAt(gTestList,gCurrentQuestion) then
  435. --    if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
  436. --    else setAt(gTestResults,gCurrentQuestion,qStatus&" Ø")
  437. --    rightAnswer spriteClicked,textBox
  438. --    set gTestScore = gTestScore+1
  439. --    set the text of cast "testScore" = "Points Scored: "&gTestScore
  440. --    if gTest then 
  441. --      startTimer
  442. --      repeat while the timer < 180 --aTimer = 1 to 3000
  443. --        nothing
  444. --      end repeat
  445. --      if gCurrentQuestion < gNumQs then aQuestion gCurrentQuestion+1
  446. --      else
  447. --        if gTest then mouseUp (script "summary script")
  448. --        set gBackToSetUp = 1
  449. --        --
  450. --      end if
  451. --    end if
  452. --    --
  453. --  else
  454. --    if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
  455. --    else setAt(gTestResults,gCurrentQuestion,qStatus)
  456. --    wrongAnswer spriteClicked,textBox
  457. --    if gTest then 
  458. --      startTimer
  459. --      repeat while the timer < 180 --aTimer = 1 to 3000
  460. --        nothing
  461. --      end repeat
  462. --      if gCurrentQuestion < gNumQs then aQuestion gCurrentQuestion+1
  463. --      else
  464. --        if gTest then mouseUp (script "summary script")
  465. --        set gBackToSetUp = 1
  466. --        --
  467. --      end if
  468. --    end if
  469. --  end if
  470. --  if gCurrentQuestion+1 > gNumQs then 
  471. --    if gTest then 
  472. --      saveResults
  473. --      set gClockOn = false
  474. --    end if
  475. --    if gTest then set the text of cast "whichq" = "done"
  476. --  end if
  477. --end checkAnswer 
  478.  
  479.  
  480. on checkAnswer
  481.   global sync
  482.   set sync = 1
  483.   global gTimeTime, gSeconds
  484.   put gSeconds into gTimetime
  485.   global gTest,gNumQs,gClockon
  486.   global gTestList,gTestResults
  487.   global gCurrentQuestion,gCurrentQList,gTestScore,gBackToSetUp
  488.   
  489.   sound stop 3
  490.   resetQCasts
  491.   put the clickOn into spriteClicked
  492.   put spriteClicked+14 into textBox
  493.   if spriteClicked < 29 then 
  494.     put spriteClicked+34 into textBox
  495.     set spriteClicked=spriteClicked+20
  496.   end if
  497.   --put textBox
  498.   set checkLoc = spriteClicked-28
  499.   set qStatus = getAt(gTestResults,gCurrentQuestion)
  500.   
  501.   if qStatus = "not tested" then set qStatus = "1"
  502.   else set qStatus = string(integer(qStatus)+1)
  503.   
  504.   if getAt(gCurrentQList,checkLoc) = getAt(gTestList,gCurrentQuestion) then
  505.     if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
  506.     else setAt(gTestResults,gCurrentQuestion,qStatus&"Ø")
  507.     rightAnswer spriteClicked,textBox
  508.     set gTestScore = gTestScore+1
  509.     set the text of cast "testScore" = "Points Scored: "&gTestScore
  510.     if gTest then 
  511.       startTimer
  512.       repeat while the timer < 180 --aTimer = 1 to 3000
  513.         nothing
  514.       end repeat
  515.       if gCurrentQuestion < gNumQs then aQuestion gCurrentQuestion+1
  516.       else
  517.         set gClockOn = false
  518.         if gTest then mouseUp (script "summary script")
  519.         set gBackToSetUp = 1
  520.         --
  521.       end if
  522.     end if
  523.     --
  524.   else
  525.     if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
  526.     else setAt(gTestResults,gCurrentQuestion,qStatus)
  527.     wrongAnswer spriteClicked,textBox
  528.     if gTest then 
  529.       startTimer
  530.       repeat while the timer < 180 --aTimer = 1 to 3000
  531.         nothing
  532.       end repeat
  533.       if gCurrentQuestion < gNumQs then aQuestion gCurrentQuestion+1
  534.       else
  535.         set gClockOn = false
  536.         if gTest then mouseUp (script "summary script")
  537.         set gBackToSetUp = 1
  538.         --
  539.       end if
  540.     end if
  541.   end if
  542.   if gCurrentQuestion > gNumQs then  --+ 1
  543.     if gTest then 
  544.       saveResults
  545.       set gClockOn = false
  546.     end if
  547.     if gTest then set the text of cast "whichq" = "done"
  548.   end if
  549. end checkAnswer 
  550.  
  551. on wrongAnswer spNum,textBox
  552.   set response = getAt(["Wrong!","Tough Luck!","Nope!","Wrong one!","Not too good!"],random(5))
  553.   if not voidP(textBox) and not (textBox > 46) then 
  554.     put response into field the castNum of sprite textBox
  555.     set the visible of sprite textbox to true
  556.   end if
  557.   set cstNum = the number of cast "test wrong" 
  558.   set the castNum of sprite spNum = cstNum
  559.   updatestage
  560. end wrongAnswer
  561.  
  562. on rightAnswer spNum,textBox
  563.   set response = getAt(["Right!","Great job!","Wow!","Yeee Haa!","Very Good!"],random(5))
  564.   if not voidP(textBox) and not (textBox > 46) then 
  565.     put response into field the castNum of sprite textBox
  566.     set the visible of sprite textbox to true
  567.   end if
  568.   set cstNum = the number of cast "test right" 
  569.   set the castNum of sprite spNum = cstNum
  570.   updatestage
  571. end rightAnswer
  572.  
  573. on resetQCasts
  574.   set cstNum = the number of cast "test blank" 
  575.   repeat with i = 29 to 32
  576.     set the castNum of sprite i = cstNum
  577.   end repeat
  578.   repeat with i = 43 to 46
  579.     set the visible of sprite i to false
  580.   end repeat
  581.   updatestage
  582. end resetQCast
  583.  
  584. on setQCasts
  585.   repeat with i = 29 to 32
  586.     puppetSprite i,true 
  587.   end repeat
  588. end setQCasts
  589.  
  590. on videoDisplay
  591.   global gSoundOn
  592.   global gTestList,gCurrentQuestion
  593.   global gDataType,videoFile,gLoopVideo
  594.   set dictRef = getAt(gTestList,gCurrentQuestion)
  595.   
  596.   cursor 4
  597.   if gDataType = "fs" then
  598.     set cstNum = the number of cast (dictRef&&"bitmap")
  599.     set the castNum of sprite 39 = cstNum
  600.     set the ink of sprite 39 = 36
  601.   else
  602.     tell window "dData" to put the text of cast dictRef into DictEntry
  603.     set the itemDelimiter to "*"
  604.     
  605.     put item 5 of DictEntry into qtRef
  606.     put item 11 of DictEntry into field "hint"
  607.     set videoFile = getName(qtRef,"MOVS")
  608.     
  609.     put char 1 to (length(item 8 of DictEntry)-3) of item 8 of DictEntry&"mov" into descSnd
  610.     if the machineType = 256 then
  611.       set descFile = getName(descSnd,"snds/Desc") --snd expl
  612.     else set descFile = getName(descSnd,"snds:Desc") --snd expl
  613.     
  614.     sound stop 3
  615.     if not (the filename of cast "sound desc" = descFile) then
  616.       set the filename of cast "sound desc" = descFile
  617.     end if
  618.     
  619.     set the filename of cast "video" to videoFile
  620.     set the itemDelimiter to ","
  621.     
  622.     set the directToStage of cast "video" to true
  623.     set the loop of cast "video" to gLoopVideo
  624.     
  625.     set cstNum = the number of cast "video"
  626.     if the castNum of sprite 39 <> cstNum then set the castNum of sprite 39 = cstNum
  627.     set the ink of sprite 39 = 0
  628.     setVideoSpeed --set the movieRate of sprite 39 to 1
  629.     
  630.     if gSoundOn then
  631.       sound playfile 3,the filename of cast "sound desc"
  632.     end if
  633.   end if
  634.   updatestage
  635.   cursor 0
  636. end videoDisplay
  637.